package com.lds.config.center.server.business.app.converter;

import com.lds.config.center.common.model.app.response.AppBaseResponse;
import com.lds.config.center.server.business.app.entity.App;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class AppToBaseResponseConverter implements Converter<App, AppBaseResponse> {

    @Override
    public AppBaseResponse convert(App source) {
        return AppBaseResponse.builder()
                .id(source.getId())
                .creator(source.getCreator())
                .modifier(source.getModifier())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .name(source.getName())
                .desc(source.getDesc())
                .clusterId(source.getClusterId())
                .build();
    }

}


